C-CDA to FHIR System API - Implementation Template

(0 reviews)

Developer guide

This document provides information generated from the DataWeave scripts included in the project, such as function definitions, variable definitions, and data mapping tables. It can be used by developers seeking a solution to convert C-CDA XML-based objects to FHIR R4 JSON.

C-CDA Document List

The table provided below includes the C-CDA document type (eg. Continuity of Care or CCD) and the corresponding CDA sections that can be reused across various FHIR conversion requirements.

DocumentDescription
Continuity Of CareThe Continuity of Care Document (CCD) represents a core data set of the most relevant administrative, demographic, and clinical information facts about a patient's healthcare, covering one or more healthcare encounters.
Supported Sections:
Allergies and Intolerances, Medications, Problem, Procedures, Results, Advanced Directives, Encounters, Family History, Functional Status, Immunization, Medical Equipment, Payers, Plan of Treatment, Social History, Vital Signs, Mental Status, Nutrition
Discharge SummaryThe Discharge Summary is a document which synopsizes a patient's admission to a hospital, LTPAC provider, or other setting. It provides information for the continuation of care following discharge.
Supported Sections:
Allergies and Intolerances, Discharge Diagnosis, Discharge Medications, Plan of Treatment, Nutrition, Family History, Functional Status, Admission Diagnosis, Admission Medications, Immunization, Problem, Procedures, Social History, Vital Signs
Consultation NoteThe Consultation Note is generated by a request from a clinician for an opinion or advice from another clinician. Consultations may involve face-to-face time with the patient or may fall under the auspices of telemedicine visits.
Supported Sections:
Allergies and Intolerances, Problem, Family History, Immunization, Medications, Procedures, Results, Social History, Vital Signs, Functional Status, Medical Equipment, Advanced Directives, Mental Status, Nutrition, Plan of Treatment
History and PhysicalA History and Physical (H&P) note is a medical report that documents the current and past conditions of the patient. It contains essential information that helps determine an individual’s health status.
Supported Sections:
Allergies and Intolerances, Family History, Medications, Results, Social History, Vital Signs, Immunization, Problem, Procedures, Plan of Treatment, Advanced Directives
Operative NoteThe Operative Note is a frequently used type of procedure note with specific requirements set forth by regulatory agencies. The Operative Note is created immediately following a surgical or other high-risk procedure.
Supported Sections:
Procedure Anesthesia, Complications, Procedure Findings, Preoperative Diagnosis, Postoperative Diagnosis, Plan of Treatment
Progress NoteProgress Note represents a patients clinical status during a hospitalization, outpatient visit, treatment with a LTPAC provider, or other healthcare encounter. It also defines as an ongoing record of a patient's illness and treatment.
Supported Sections:
Allergies and Intolerances, Medications, Problem, Results, Vital Signs, Nutrition, Plan of Treatment, Advanced Directives
Procedure NoteA Procedure Note encompasses many types of non-operative procedures including interventional cardiology, gastrointestinal endoscopy, osteopathic manipulation, and many other specialty fields. Procedure Notes are differentiated from Operative Notes because they do not involve incision or excision as the primary act.
Supported Sections:
Allergies and Intolerances, Family History, Medications, Procedures, Social History, Complications, Postprocedure Diagnosis, Procedure Indications, Procedure Findings, Procedure Anesthesia
Referral NoteA Referral Note communicates pertinent information from a provider who is requesting services of another provider of clinical or non-clinical services. The information in this document includes the reason for the referral and additional information that would augment decision making and care delivery.
Supported Sections:
Reason for Referral, Problem, Allergies and Intolerances, Medications, Family History, Immunization, Procedures, Results, Social History, Vital Signs, Functional Status, Medical Equipment, Advanced Directives, Mental Status, Nutrition
Transfer SummaryThe Transfer Summary standardizes critical information for exchange of information between providers of care when a patient moves between health care settings.
Supported Sections:
Advanced Directives, Allergies and Intolerances, Encounters, Family History, Functional Status, Discharge Diagnosis, Immunization, Medical Equipment, Medications, Payers, Plan of Treatment, Problem, Procedures, Results, Social History, Vital Signs, Mental Status, Nutrition, Admission Diagnosis, Admission Medications, Reason for Referral

convertAdmissionDiagnosisToFHIR

Converts Admission Diagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertAdmissionDiagnosisToFHIR.dwl

Functions

fun getCdaAdmissionDiagnosis (payload)

Gets a list of C-CDA admission diagnosis objects from the input payload.

param payload is the input XML CDA request.
return A list of C-CDA admission diagnosis objects or an empty list.

fun getCdaAdmissionDiagnosisEntries (cdaAdmissionDiagnosis)

Gets a filtered list of C-CDA admission diagnostic entries.

param cdaAdmissionDiagnosis is a list of C-CDA entries.
return A filtered list of C-CDA admission diagnosis entries or an empty list.

fun buildAdmissionDiagnosisObservations (cdaAdmissionDiagnosisEntries, patientId, practitionersList)

Builds a list of admission diagnosis FHIR Observation objects.

param cdaAdmissionDiagnosisEntries is a filtered list of C-CDA admission diagnosis entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.

(back to top)

convertAdmissionMedicationsToFHIR

Converts Admission Medications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Medication
MedicationRequest
MedicationDispense
MedicationStatement

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertAdmissionMedicationsToFHIR.dwl

Functions

fun getCdaMedicationSections (payload)

Gets a list of C-CDA medication sections from the input payload.

param payload is the input XML CDA request.
return A list of C-CDA medication sections or an empty list.

fun buildMedication (cdaMedicationSections)

Builds a list of FHIR formatted Medication objects.

param cdaMedicationSections is a list of C-CDA medication sections.
return A FHIR formatted list of Medication objects or an empty list.

fun buildMedicationRequest (cdaMedicationSections, patientId, practitionersList)

Builds a list of FHIR formatted MedicationRequest objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationRequest objects or an empty list.

fun buildMedicationDispence (cdaMedicationSections, patientId, medicationRequest, practitionersList)

Builds a list of FHIR formatted MedicationDispence objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationDispence objects or an empty list.

fun buildMedicationStatement (cdaMedicationSections, patientId, medicationRequest, medicationDispense)

Builds a list of FHIR formatted MedicationStatement objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param medicationDispense is a list of FHIR formatted MedicationDispense objects.
return A FHIR formatted list of MedicationStatement objects or an empty list.

(back to top)

convertAdvancedDirectiveToFHIR

Converts Advanced Directives section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Consent
DocumentReference
Practitioner

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertAdvancedDirectiveToFHIR.dwl

(back to top)

convertAllergyIntoleranceToFHIR

Converts Allergy Intolerance section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
AllergyIntolerance
ClinicalImpression
Practitioner

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertAllergyIntoleranceToFHIR.dwl

Functions

fun buildClinicalImpressions (clinicalImpressions, patientId, practitionersList, allergyList)

Builds the ClinicalImpression FHIR objects and returns them as a list.

param clinicalImpressions is a list of clinical impression C-CDA objects.
param patientId is a string with the patient ID.
param practitionersList is a list of the C-CDA practitioners.
param allergyList is a list of FHIR formatted AllergyIntolerance objects.
return A list of FHIR formatted ClinicalImpressions objects.

fun buildAllergies (clinicalImpressions, patientId, practitionersList)

Builds the allergy FHIR objects and returns them as a list.

param clinicalImpressions is a list of clinical impression C-CDA objects.
param patientId is a string with the patient ID.
param practitionersList is a list of the C-CDA practitioners.
return A list of FHIR formatted AllergyIntolerance objects.

fun getAllergies (ClinicalImpressions)

Gets a list of allergy objects with the provided list of clinical impressions. Uses getEntryRelationshipResource function from cdaToFHIRTools

param ClinicalImpressions is a list of clinical impression objects.
return A list of allergy objects or empty list.

fun getClinicalImpressions (payload)

Gets the clinical impressions with the provided payload. Uses getEntrySection function from cdaToFHIRTools

param payload is the input XML CDA request.
return A list of clinical impressions or an empty list.

(back to top)

convertComplicationToFHIR

Converts Complication section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertComplicationToFHIR.dwl

Functions

fun getComplicationSection (payload)

Gets a list of C-CDA complication objects.

param payload is the input XML CDA request.
return A list of C-CDA complication objects or an empty list.

fun getComplicationEntries (complicationSection)

Gets a filtered list of C-CDA complication entries.

param complicationSection is a list of C-CDA complication objects.
return A filtered list of C-CDA complication entries.

fun buildComplicationConditions (complicationEntries, patientId, practitionersList)

Builds a list of FHIR formatted Condition objects.

param complicationEntries is a filtered list of C-CDA complication entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convertDischargeDiagnosisToFHIR

Converts Discharge Diagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertDischargeDiagnosisToFHIR.dwl

Functions

fun getCdaDischargeDiagnosis (payload)

Gets a list of C-CDA discharge diagnosis objects.

param payload is the input XML CDA request.
return A list of C-CDA discharge diagnosis objects or an empty list.

fun getCdaDischargeDiagnosisEntries (cdaDischargeDiagnosis)

Gets a filtered list of C-CDA discharge diagnosis entries.

param cdaDischargeDiagnosis is a list of C-CDA discharge diagnosis objects.
return A filtered list of C-CDA discharge diagnosis entries.

fun buildDischargeDiagnosisCondition (cdaDischargeDiagnosisEntries, patientId, practitionersList)

Builds a list of FHIR formatted Condition objects.

param cdaDischargeDiagnosisEntries is a filtered list of C-CDA discharge diagnosis entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convertDischargeMedicationsToFHIR

Converts Discharge Medications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition
Practitioner
Medication
MedicationDispense
MedicationAdministration
Organization

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertDischargeMedicationsToFHIR.dwl

Functions

fun getCdaMedications (payload)

Gets a list of C-CDA medication objects.

param payload is the input XML CDA request.
return A list of C-CDA medication objects or an empty list.

fun getCdaMedicationsEntries (cdaDischargeMedications)

Filters and returns a list of C-CDA medication entries.

param cdaDischargeMedications is a list of C-CDA medication objects to filter.
return A filtered list of C-CDA medication entries or an empty list.

fun buildDischargeOrganization (cdaDischargeMedicationsEntries)

Builds a list of FHIR formatted discharge Organization objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
return A list of FHIR formatted Organization objects or an empty list.

fun buildDischargeMedication (cdaDischargeMedicationsEntries)

Builds a list of FHIR formatted discharge Medication objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
return A list of FHIR formatted Medication objects or an empty list.

fun buildDischargeMedicationAdministration (cdaDischargeMedicationsEntries, patientId, dischargeMedicationIds)

Builds a list of FHIR formatted discharge MedicationAdministration objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
param patientId is a string with the patient ID.
param dischargeMedicationIds is a list of discharge medication IDs.
return A list of FHIR formatted MedicationAdministration objects or an empty list.

fun buildDischargeMedicationCondition (cdaDischargeMedicationsEntries, patientId, practitionersList)

Builds a list of FHIR formatted discharge medication Condition objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted medication Condition objects or an empty list.

fun buildDischargeMedicationDispensePractitioner (cdaDischargeMedicationsEntries)

Builds a list of FHIR formatted discharge medication dispense Practitioner objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
return A list of FHIR formatted discharge medication dispense Practitioner objects or an empty list.

fun buildDischargeMedicationDispense (cdaDischargeMedicationsEntries, patientId, dischargeMedicationIds, dischargeMedicationDispensePractitionersIds)

Builds a list of FHIR formatted discharge MedicationDispense objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
param patientId is a string with the patient ID.
param dischargeMedicationIds is a list of discharge medication IDs.
param dischargeMedicationDispensePractitionersIds is a list of discharge medication dispense practitioner IDs.
return A list of FHIR formatted discharge MedicationDispense objects or an empty list.

(back to top)

convertEncounterToFHIR

Converts Encounters section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Encounter
Location

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertEncounterToFHIR.dwl

Functions

fun getEncounters (payload)

Gets a list of C-CDA encounter objects with the provided payload.

param payload is the input CDA XML request.
return A list of C-CDA encounter objects or an empty array.

fun buildLocations (cdaEncounters)

Builds a list of FHIR formatted Location objects with the provided list of encounters and location ID.

param cdaEncounters is a list of C-CDA encounter objects.
return A list of FHIR formatted Location objects or a blank list.

fun buildEncounters (cdaEncounters, patientId, locId, practitionerList)

Builds a list of FHIR formatted Encounter objects with the provided arguments.

param cdaEncounters is a list of C-CDA encounter objects.
param patientId is a string with the patient ID.
param locId is a string with the location ID.
param practitionersList is a list of practitioners.
return a list of FHIR formatted Encounter objects or an empty list.

(back to top)

convertFamilyHistoryToFHIR

Converts Family History section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
FamilyHistory

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertFamilyHistoryToFHIR.dwl

Functions

fun buildFamilyHistory (familyHistoryList, fhirFamHistConstants, patientId)

Function to build a list of FamilyHistory FHIR R4 resources using input C-CDA Family History section. Uses getEntrySection from cdaToFHIRTools.

param familyHistoryList is a list of family history organizer objects.
param fhirFamHistConstants is a list of constants used to in FHIR R4 mapping.
param patientId is the id of the patient.
return An array of FHIR R4 FamilyHistory resources.

(back to top)

convertFunctionalStatusToFHIR

Converts Functional Status section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation
DeviceUseStatement

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertFunctionalStatusToFHIR.dwl

Functions

fun getCdaFunctionalStatus (payload)

Gets a list of C-CDA functional status objects with the provided payload.

param payload is the input XML CDA request.
return A list of C-CDA functional status objects or an empty list.

fun getCdaFunctionalStatusOrganizer (cdaFunctionalStatus)

Gets a list of C-CDA functional status organizer objects with the provided list of C-CDA functional status objects.

param cdaFunctionalStatus is a list of C-CDA functional status objects.
return A list of C-CDA functional status organizer objects or empty list.

fun buildFunctionalObservations (functionalStatusOrganizer, patientId, perfRefList)

Builds a list of FHIR functional Observation objects with the provided functional status organizer list and patient ID.

param functionalStatusOrganizer is a C-CDA functional status organizer list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildSelfCareObservations (functionalStatusOrganizer, patientId, perfRefList)

Builds a list of FHIR self care Observation objects with the provided functional status organizer list and patient ID.

param functionalStatusOrganizer is a C-CDA functional status organizer list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildSensoryObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR sensory Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildAssessmentScaleObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR assessment scale Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildProblemObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR problem Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildNonMedDeviceSupply (cdaFunctionalStatus, patientId)

Builds a list of FHIR non medical device supply DeviceUseStatment objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildCareGiverCharObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR care giver Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

(back to top)

convertImmunizationToFHIR

Converts Immunization section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Immunization

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertImmunizationToFHIR.dwl

Functions

fun getCdaImmunizations (payload)

Gets a list of C-CDA immunization objects with the provided payload.

param payload is the input XML CDA request.
return A list of C-CDA immunization objects or an empty array.

fun buildImmunizations (cdaImmunizations, patientId, performersList)

Builds a list of FHIR formatted Immunization objects with the provided list of C-CDA immunization objects.

param cdaImmunizations is a list of C-CDA immunization objects.
param patientId is a string with the patient ID.
param performersList is the list of performers.
return A list of FHIR formatted Immunization objects or an empty list.

(back to top)

convertMedicalEquipmentToFHIR

Converts Medical Equipment section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Device
Organization
Procedure

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertMedicalEquipmentToFHIR.dwl

Functions

fun buildMedicalEquipment (payload, templateId)

Build the MedicalEquipment Section FHIR objects and returns them as a list.

param payload is input XML CDA request.
param templateId is the Template ID.
return A list of MedicalEquipment Section or an empty list.

fun buildMedicalEquipmentOrganizer (medicalEquipment, templateId)

Build the MedicalEquipmentOrganizer FHIR objects and returns them as a list.

param medicalEquipment is a list of MedicalEquipment C-CDA objects.
param templateId is the Template ID.
return A list of MedicalEquipmentOrganizer list or an empty list.

fun buildNonMedicalSupply (medicalEquipment, templateId)

Build the NonMedicalSupply FHIR objects and returns them as a list.

param medicalEquipment is a list of MedicalEquipment C-CDA objects.
param templateId is the Template ID.
return A list of NonMedicalSupply list or an empty list.

fun buildSupplyResources (medicalEquipmentOrganizer, nonMedicalSupply)

Build the SupplyResources FHIR objects and returns them as a list.

param medicalEquipmentOrganizer is a list of medicalEquipmentOrganizer C-CDA objects.
param nonMedicalSupply is a list of nonMedicalSupply C-CDA objects.
return A list of SupplyResources list or an empty list.

fun buildDeviceList (supplyResources)

Build the DeviceIds FHIR objects and returns them as a list.

param supplyResources is a list of Supply Resources C-CDA objects.
return A list of Device list or an empty list.

fun buildMedicalEquipProcedureList (medicalEquipment)

Build the MedicalEquipProcedure list FHIR objects and returns them as a list.

param medicalEquipment is a list of Supply Resources C-CDA objects.
return A list of MedicalEquipProcedure list or an empty list.

fun buildMedEquipPerformers (medicalEquipProcedureList)

Build the MedEquipPerformers list FHIR objects and returns them as a list.

param medicalEquipProcedureList is a list of Supply Resources C-CDA objects.
return A list of MedEquipPerformers list or an empty list.

fun buildMedEquipPerformersList (medEquipPerformers)

Build the MedEquipPerformers list FHIR objects and returns them as a list.

param medEquipPerformers is a list of Supply Resources C-CDA objects.
return A list of MedEquipPerformers list or an empty list.

fun buildMedEquipProcedure (medicalEquipProcedureList)

Build the Medical Equipment Procedure list FHIR objects and returns them as a list.

param medicalEquipProcedureList is a list of Supply Resources C-CDA objects.
return A list of Medical Equipment Procedure list or an empty list.

(back to top)

convertMedicationSectionToFHIR

Converts Medications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Medication
MedicationRequest
MedicationDispense
MedicationStatement

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertMedicationSectionToFHIR.dwl

Functions

fun getCdaMedicationSections (payload)

Gets a list of C-CDA medication sections.

param payload is the input XML CDA request.
return A list of C-CDA medication sections or an empty list.

fun buildMedication (cdaMedicationSections)

Builds a FHIR formatted list of Medication objects.

param cdaMedicationSections is a list of C-CDA medication objects.
return A FHIR formatted list of Medication objects or an empty list.

fun buildMedicationRequest (cdaMedicationSections, patientId, practitionersList)

Builds a list of FHIR formatted MedicationRequest objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationRequest objects or an empty list.

fun buildMedicationDispense (cdaMedicationSections, patientId, medicationRequest, practitionersList)

Builds a list of FHIR formatted MedicationDispence objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationDispence objects or an empty list.

fun buildMedicationStatement (cdaMedicationSections, patientId, medicationRequest, medicationDispense)

Builds a list of FHIR formatted MedicationStatement objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param medicationDispense is a list of FHIR formatted MedicationDispense objects.
return A FHIR formatted list of MedicationStatement objects or an empty list.

(back to top)

convertMentalHealthToFHIR

Converts Mental Health section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertMentalHealthToFHIR.dwl

Functions

fun getCdaMentalStatusEntries (payload)

Gets a list of C-CDA mental status entries objects with the provided payload.

param payload is the input XML CDA request.
return A list of C-CDA mental status entries objects or an empty list.

fun getCdaAssessmentObservations (cdaMentalStatusEntries)

Gets a list of C-CDA assessment observation objects with the provided payload.

param cdaMentalStatusEntries is a list of C-CDA mental status entries.
return A list of C-CDA assessment observation objects or an empty list.

fun buildAssessmentObservation (cdaAssessmentObservations, patientId, perfRefList)

Builds a list of FHIR formatted assessment Observation objects.

param cdaAssessmentObservations is a list of C-CDA assessment observation objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted assessment Observation objects or an empty list.

fun getCdaMentalStatusObservations (cdaMentalStatusEntries)

Gets a list of C-CDA mental status observation objects with the provided payload.

param cdaMentalStatusEntries is a list of C-CDA mental status entries.
return A list of C-CDA mental status observation objects or an empty list.

fun buildMentalStatusObservation (cdaMentalStatusObservations, patientId, perfRefList)

Builds a list of FHIR formatted mental status Observation objects.

param cdaMentalStatusObservations is a list of C-CDA mental status observation objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted mental status Observation objects or an empty list.

(back to top)

convertNutritionToFHIR

Converts Nutrition section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertNutritionToFHIR.dwl

Functions

fun getCdaNutritionSections (payload)

Gets a list of C-CDA nutrition section objects.

param payload is the input XML CDA request.
return A list of C-CDA nutrition section objects or an empty list.

fun getCdaNutritionObservations (cdaNutritionSections)

Gets a list of C-CDA nutrition observation objects.

param cdaNutritionSections is a list of C-CDA nutrition section objects.
return A list of C-CDA nutrition observation objects or an empty list.

fun getCdaNutritionAssessments (cdaNutritionObservations)

Gets a list of C-CDA nutrition assessment objects.

param cdaNutritionSections is a list of C-CDA nutrition section objects.
return A list of C-CDA nutrition assessment objects or an empty array.

fun buildNutritionObservations (cdaNutritionAssessments, patientId, perfRefList)

Gets a list of FHIR formatted nutrition Observation objects with the provided C-CDA nutrition assessments.

param cdaNutritionAssessments is a list of C-CDA nutrition assessment objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted nutrition Observation objects or an empty list.

(back to top)

convertPayerToFHIR

Converts Payers section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Organization
Coverage

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertPayerToFHIR.dwl

Functions

fun getPayersSection (payload)

Gets payer org and from within that, fetch payers and coverage with the provided payload.

param payload is the input XML CDA request.
return A array of payers and coverage or empty array.

fun getCoverage (payersSection)

Gets the coverage with the payer org.

param payersSection is payers and coverage with the provided payload.
return A list of coverage or an empty list.

fun getPolicy (coverage)

Gets the policy with the payer org.

param coverage is policy that covers in payer org.
return A list of coverage or an empty list.

fun buildPayers (payersSection)

Creates the list of organizations with the payer org.

param payersSection is payers and coverage with the provided payload.
return A list of organizations or an empty list.

fun buildPolicy (policy)

Creates the list of coverage with the payer org.

param payersSection is payers and coverage with the provided payload.
return A list of coverage or an empty list.

fun getPayerIds (payers)

Gets the payer id's with the payer org.

param payers is list of payers in payer org.
return A list of payer id's or empty list.

(back to top)

convertPlanOfTreatmentToFHIR

Converts Plan of Treatment section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Goal
ServiceRequest
MedicationRequest

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertPlanOfTreatmentToFHIR.dwl

Variables

var planSection

Filter payload to fetch various plan section subsets.

Functions

fun getPlanSectionAuthors (plannedObsrv, plannedEncounter, planActs, planProcs, planMedAct, planSupply, planImmAct, planNutritionSect, planGoalObsrv)

Function to extract authors from all planed action sections.

param plannedObsrv is the list of planned observation.
param plannedEncounter is the list of planned encounters.
param planActs is the list of planned acts.
param planProcs is the list of planned procedures.
param planMedAct is the list of planned medication activity.
param planSupply is the list of planned supply.
param planImmAct is the list of planned immunization activity.
param planNutritionSect is the list of planned nutrition recommendation.
param planGoalObsrv is the list of planned goal observation.

fun buildServRequests (servList, fhirServConstants, patientId, refList)

Function to build FHIR R4 Service Requests from Plan of Treatment Section. Uses createServiceRequest function.

param servList is a list of C-CDA format service requests.
param fhirServConstants is a list of constants used for mapping.
param patientId is the patient's Id.
param refList is a list of practitioner references for author mapping.
return An array of FHIR formatted Service Requests List.

fun buildPlannedMedicationRequests (medReqList, fhirMedConstants, patientId, refList)

Function to build FHIR R4 Planned Medication Requests from Plan of Treatment Section. Uses createServiceRequest function.

param medReqList is a list of C-CDA format Planned Medication requests.
param fhirServConstants is a list of constants used for mapping.
param patientId is the patient's Id.
param refList is a list of practitioner references for author mapping.
return An array of FHIR formatted Planned Medication Requests List.

fun buildGoal (goalReqs, patientId)

Function to build FHIR R4 Goal Requests from Plan of Treatment Section. Uses createServiceRequest function.

param goalReqs is a list of C-CDA format Goal requests.
param patientId is the patient's Id.
return An array of FHIR formatted Goal objects List.

(back to top)

convertPostOperativeDiagnosisToFHIR

Converts PostoperativeDiagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertPostOperativeDiagnosisToFHIR.dwl

Functions

fun getPostoperativeDiagnosisSection (payload)

Gets a list of C-CDA PostoperativeDiagnosis objects.

param payload is the input XML CDA request.
return A list of CDA PostoperativeDiagnosis objects or an empty list.

fun getPostoperativeDiagnosisActEntries (postoperativeDiagnosisSection)

Gets a filtered list of C-CDA PostoperativeDiagnosis entries.

param postoperativeDiagnosisSection is a list of C-CDA PostoperativeDiagnosis objects.
return A filtered list of C-CDA PostoperativeDiagnosis entries.

fun getPostoperativeDiagnosisObservations (postoperativeDiagnosisActEntries)

Gets a filtered list of C-CDA PostoperativeDiagnosis observations.

param postoperativeDiagnosisActEntries is a list of C-CDA PostoperativeDiagnosis entries.
return A filtered list of C-CDA PostoperativeDiagnosis observations objects.

fun buildPostoperativeDiagnosisConditions (postoperativeDiagnosisObservations, patientId, practitionersList)

Builds a list of FHIR formatted PostoperativeDiagnosis Condition objects.

param postoperativeDiagnosisObservations is a filtered list of C-CDA PostoperativeDiagnosis observation objects.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convertPostPostprocedureDiagnosis

Converts Postprocedure Diagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertPostPostprocedureDiagnosis.dwl

Functions

fun getPostprocedureDiagnosisSection (payload)

Gets a list of C-CDA Postprocedure Diagnosis objects.

param payload is the input XML CDA request.
return A list of C-CDA PostprocedureDiagnosis objects or an empty list.

fun getPostprocedureDiagnosisEntries (postprocedureDiagnosisSection)

Gets a filtered list of C-CDA Postprocedure Diagnosis entries.

param postprocedureDiagnosisSection is a list of C-CDA PostprocedureDiagnosis objects.
return A filtered list of C-CDA PostprocedureDiagnosis entries.

fun buildPostprocedureDiagnosisConditions (postprocedureDiagnosisEntries, patientId, practitionersList)

Builds a list of FHIR formatted Postprocedure Diagnosis Condition objects.

param postprocedureDiagnosisEntries is a filtered list of C-CDA PostprocedureDiagnosis entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convertPreoperativeDiagnosisToFHIR

Converts PreoperativeDiagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertPreoperativeDiagnosisToFHIR.dwl

Functions

fun getPreoperativeDiagnosisSection (payload)

Gets a list of C-CDA PreoperativeDiagnosis objects.

param payload is the input XML CDA request.
return A list of C-CDA PreoperativeDiagnosis objects or an empty list.

fun getPreoperativeDiagnosisActEntries (preoperativeDiagnosisSection)

Gets a filtered list of C-CDA PreoperativeDiagnosis entries.

param preoperativeDiagnosisSection is a list of C-CDA PreoperativeDiagnosis objects.
return A filtered list of C-CDA PreoperativeDiagnosis entries.

fun getPreoperativeDiagnosisObservations (preoperativeDiagnosisActEntries)

Gets a filtered list of C-CDA PreoperativeDiagnosis observations.

param preoperativeDiagnosisActEntries is a list of C-CDA PreoperativeDiagnosis entries.
return A filtered list of C-CDA PreoperativeDiagnosis observations objects.

fun buildPreoperativeDiagnosisConditions (preoperativeDiagnosisObservations, patientId, practitionersList)

Builds a list of FHIR formatted PreoperativeDiagnosis Condition objects.

param preoperativeDiagnosisObservations is a filtered list of C-CDA PreoperativeDiagnosis observation objects.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convertProblemToFHIR

Converts Problems section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition
ClinicalImpression
Practitioner

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertProblemToFHIR.dwl

Functions

fun buildConditions (problemConcerns, conditionTemplateId, resourceType, fhirProblemConstants, perfRefList)

Function to build condition FHIR resources using the input C-CDA Observations. Uses function getEntryRelationshipResource to fetch the C-CDA observations list, which is then mapped to FHIR R4 Condition.

param problemConcerns is a list of C-CDA "act" resource.
param conditionTemplateId is the C-CDA templateId for Conditions.
param resourceType is the type of object to be selected for Condition. Example: observation.
param fhirProblemConstants is a list of constants used for mapping.

fun buildClinicalImpressions (problemsList, patientId, practList, conditionsList, impressionType)

Function to build condition FHIR resources using the input C-CDA's Act. Uses createClinicalImpression function from cdaToFHIRTools.

param problemList is the list of C-CDA "act" from the input.
param patientId identifies the id of patient to be used for reference.

(back to top)

convertProcedureAnesthesiaToFHIR

Converts ProcedureAnesthesia section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Organization
Practitioner
Procedure
Observation
Medication
MedicationAdministration

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertProcedureAnesthesiaToFHIR.dwl

Functions

fun buildProcedureAnesthesiaSection (payload, templateId)

Build the Procedure Anesthesia Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Procedure Anesthesia Section or an empty list.

fun buildProcedureEntries (procedureAnesthesiaSection, templateId)

Build the Procedure Activity Section FHIR objects and returns them as a list.

param procedureAnesthesiaSection is a list of C-CDA objects.
param templateId is the Template ID.
return A list of Procedure objects or an empty list.

fun buildMedicationEntries (procedureAnesthesiaSection, templateId)

Build the Medication Section FHIR objects and returns them as a list.

param procedureAnesthesiaSection is a list of C-CDA Medication section objects.
param templateId is the Template ID.
return A list of Medication objects or an empty list.

fun buildRepresentedOrganization (performers)

Build the represented organization FHIR objects and returns them as a list.

param performers is a list of C-CDA objects.
return A list of procedure observation or an empty list.

fun buildProceduresList (procedureEntries)

Build the procedures FHIR objects and returns them as a list.

param procedureEntries is a list of C-CDA procedure entries.
return A list of procedure or an empty list.

fun buildMedicationAdministration (medicationEntries, patientId, medicationIds)

Builds a list of FHIR formatted MedicationAdministration objects.

param medicationEntries is a list of C-CDA medication entries.
param patientId is a string with the patient ID.
param medicationIds is a list of medication IDs.
return A list of FHIR formatted MedicationAdministration objects or an empty list.

fun buildMedications (medicationEntries)

Builds a list of FHIR formatted Medication objects.

param medicationEntries is a list of C-CDA medication entries.
return A list of FHIR formatted Medication objects or an empty list.

(back to top)

convertProcedureFindingToFHIR

Converts ProcedureFinding section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertProcedureFindingToFHIR.dwl

Functions

fun getProcedureFindingSection (payload)

Gets a list of C-CDA ProcedureFinding objects.

param payload is the input XML CDA request.
return A list of C-CDA ProcedureFinding objects or an empty list.

fun getProcedureFindingEntries (procedureFindingSection)

Gets a filtered list of C-CDA ProcedureFinding entries.

param procedureFindingSection is a list of C-CDA ProcedureFinding objects.
return A filtered list of C-CDA ProcedureFinding entries.

fun buildProcedureFindingConditions (procedureFindingEntries, patientId, practitionersList)

Builds a list of FHIR formatted ProcedureFinding Condition objects.

param procedureFindingEntries is a filtered list of C-CDA ProcedureFinding entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convertProcedureIndications

Converts Procedure Indications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertProcedureIndications.dwl

Functions

fun buildProcedureIndicationsSection (payload, templateId)

Build the Procedure Indications Section FHIR objects and returns them as a list.

param payload is input XML CDA request.
param templateId is the Template ID.
return A list of Procedure Indications or an empty list.

fun buildProcedureIndicationsObservations (procedureIndications, templateId)

Build the Procedure Indications Observations FHIR objects and returns them as a list.

param socialHistory is a list of Procedure Indications C-CDA objects.
param templateId is the Template ID.
return A list of Procedure Indications or an empty list.

(back to top)

convertProcedureToFHIR

Converts Procedures section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Organization
Practitioner
Procedure
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertProcedureToFHIR.dwl

Functions

fun buildProcedureSection (payload, templateId)

Build the Procedure Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Procedure Section or an empty list.

fun buildProcedureActivityProcedure (procedureSection, templateId)

Build the Procedure Activity Section FHIR objects and returns them as a list.

param procedureSection is a list of C-CDA objects.
param templateId is the Template ID.
return A list of procedure activity or an empty list.

fun buildProcedureObservations (procedureSection, templateId)

Build the procedure observations FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of procedure observation or an empty list.

fun buildProcedureActs (procedureSection, templateId)

Build the procedure observations FHIR objects and returns them as a list.

param procedureSection is a list of C-CDA procedure section objects.
param templateId is the Template ID.
return A list of procedure observation or an empty list.

fun buildProceduresList (procedureActs, procedureActivityProcedure)

Build the procedures list FHIR objects and returns them as a list.

param performers is a list of C-CDA performers objects.
param templateId is the Template ID.
return A list of procedure or an empty list.

(back to top)

convertReasonforReferralToFHIR

Creates the Reason for Referral section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
ServiceRequest

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertReasonforReferralToFHIR.dwl

Functions

fun buildServRequests (servList, fhirServConstants, patientId, refList)

Function to build FHIR R4 Service Requests from Plan of Treatment Section. Uses createServiceRequest function.

param servList is a list of CDA format service requests.
param fhirServConstants is a list of constants used for mapping.
param patientId is the patient's Id.
param refList is a list of practitioner references for author mapping.
return An array of FHIR formatted Service Requests List.

(back to top)

convertResultsToFHIR

Converts Results section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertResultsToFHIR.dwl

Functions

fun buildDiagnosticReportSection (payload, templateId)

Build the Diagnostic Report Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Diagnostic Report Section or an empty list.

fun buildDiagnosticObservations (diagnosticReport, templateId, perfRefList)

Build the Diagnostic Report Observations FHIR objects and returns them as a list.

param diagnosticReport is a list of Diagnostic Report C-CDA objects.
param templateId is the Template ID.
return A list of Social History or an empty list.

fun buildDiagnosticObservationIds (diagnosticObservations)

Build the Diagnostic Observations ID objects and returns them as a list.

param diagnosticObservations is a list of Diagnostic Report C-CDA objects.
param templateId is the Template ID.
return A list of Diagnostic Observation IDs or an empty list.

(back to top)

convertSocialHistoryToFHIR

Converts Social History section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertSocialHistoryToFHIR.dwl

Functions

fun buildSocialHistorySection (payload, templateId)

Build the Social History Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Social History Section or an empty list.

fun buildSocialHistoryObservations (socialHistory, templateId)

Build the Social History Observations FHIR objects and returns them as a list.

param socialHistory is a list of Social History C-CDA objects.
param templateId is the Template ID.
return A list of Social History or an empty list.

(back to top)

convertVitalSignsToFHIR

Converts Vital Signs section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convertVitalSignsToFHIR.dwl

Functions

fun buildVitalSignSection (payload, templateId)

Build the VitalSign Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Vital Signs Section or an empty list.

fun buildVitalSignObservations (vitalSigns, templateId, perfRefList)

Build the VitalSign Observations FHIR objects and returns them as a list.

param vitalSigns is a list of Vital Signs C-CDA objects.
param templateId is the Template ID.
return A list of Vital Signs or an empty list.

(back to top)

createFHIRR4AllergyIntolerance

This module implements functions to support creation of FHIR R4 AllergyIntolerance.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4AllergyIntolerance.dwl

Functions

fun allergyIntoleranceCategoryLookUp (incode)

Function to lookup C-CDA AllergyIntolerance category type and fetch FHIR type.

param incode is C-CDA format code.
return A FHIR format code.

fun createAllergyIntolerance (allergy, fhirAllergyConstants, allergyId, patientId, practitionerList)

Function to create AllergyIntolerance FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param allergy is a object from the CDA input XML, containing AllergyIntolerance information.
param fhirAllergyConstants is a list of constants to be used for mapping.
param patientId is the patient id.
param allergyId is id for the resource.
param practitionerList is a list of practitioner identifiers and IDs.
return A FHIR format AllergyIntolerance object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemallergy.idIdentifier system for resource
identifier.valueallergy.idIdentifier value for resource
clinicalStatus.coding.systemConstant clinicalStatusSystem from fhirConstants.AllergyIntolerance
clinicalStatus.coding.codeallergy.effectiveTimeUse function getClinicalStatus to lookup code
categoryallergy.value.codeUse function allergyIntoleranceCategoryLookUp to lookup category
recordedDateallergy.author.time.valueFormat datetime using function formatDateTime
recorder.referenceallergy.author.assignedAuthor.id.extensionLookup practitioner id from practitionerList
code.coding.systemConstant codeCodeSystem from fhirConstants.AllergyIntolerance
code.coding.codeallergy.participant.participantRole.playingEntity.code.codeAllergy Intolerance Code
code.coding.systemConstant codeCodeSystem from fhirConstants.AllergyIntolerance
code.coding.displayallergy.participant.participantRole.playingEntity.code.displayNameAllergy Intolerance Display Name
patient.referencepatientIdPatient ID created from recordTarget
reaction.onsetallergy.entryRelationship.observation.effectiveTime.low.valueReaction Onset Time
reaction.substance.coding.codeallergy.entryRelationship.observation.participant.participantRole.playingEntity.code.codeAllergy Substance code
reaction.substance.coding.systemConstant codeCodeSystem from fhirConstants.AllergyIntolerance
reaction.substance.coding.displayallergy.entryRelationship.observation.participant.participantRole.playingEntity.code.displayNameAllergy Substance Code Name
onsetDateTimeallergy.author.time.valueFormat datetime using formatDateTime

fun getClinicalStatus (effectivedate)

Gets the clinical status field with the provided effective date.

param effectivedate is an effective date object.
return A string with resolved, active, or inactive.

(back to top)

createFHIRR4ClinicalImpression

This module implements functions to support creation of FHIR R4 ClinicalImpression.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4ClinicalImpression.dwl

Functions

fun createClinicalImpression (clin, patientId, practList, clinId, refList, refType)

Function to create ClincalImpression FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param clin is a object from the CDA input XML, containing ClincalImpression information.
param fhirProblemConstants is a list of constants to be used for mapping.
param patientId is the patient id.
param clinId is id for the resource.
param practList is a list of practitioner identifiers and IDs.
param refList is a list of references.
param refType is a literal of the reference type.
return A FHIR format ClincalImpression object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemclin.idIdentifier system for resource
identifier.valueclin.idIdentifier value for resource
statusConstant "completed"
subject.referencepatientIdPatient ID created from recordTarget
effectivePeriod.startclin.effectiveTime.low.valueClinical Impression Start Date
effectivePeriod.endclin.effectiveTime.high.valueClinical Impression End Date
performer.referenceclin.author.assignedAuthor.id.extensionLookup practList using the extension for id
problem.referenceclin.entryRelationship.observation.id.rootLookup refList using entryRelationship.observation.id.root for problem reference

(back to top)

createFHIRR4Composition

This module implements functions to support creation of FHIR R4 Composition.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Composition.dwl

Functions

fun createCompositionSection (resourceSection, resourceList, compConstants)

Function to create section array for composition.

param resourceSection is a object from the CDA input XML request, containing Clinical Document Resource information.
param compConstants is a list of constants to be used for mapping.
param resourceList is a list of FHIR resources converted for the resourceSection.
return An array of section for Composition.

FHIRR4 Element NameC-CDA Element NameMapping Description
titleresourceSection.titleId generated using uuid() for resource
text.statusConstant "generated"
text.divresourceSection.code.displayName or resourceSection.titleConcat with w3org url to create div
code.coding.coderesourceSection.code.codeComposition Section Code
code.coding.systemresourceSection.code.codeSystemUse function mapCodeSystem to lookup code system
modeConstant compSectionMode from fhirConstants.Composition
statusConstant compStatus from fhirConstants.Composition
entry.referenceresourceList.resource.resourceType ++ resourceList.resource.idCreate an entry using resourceType and id
entry.dispalyresourceList.resource.code.coding.displayResource name for section

fun createCompositionHeader (compId, compHeader, compConstants, practList, patientId, custodianOrgId, encounterId, organizationsList)

Function to create FHIR object from incoming C-CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param compId is ID for the resource.
param compHeader is a object from the CDA input XML, containing Clinical Document header information.
param compConstants is a list of constants to be used for mapping.
param practList is a list of practitioner identifiers and IDs.
param patientId is the patient ID.
param custodianOrgId is the Custodian orgId.
param encounterId is the Encompassing encounter Id.
param organizationsList is a list of organizations identifiers and IDs.
return - FHIR format Composition Header object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idcompHeader.setId.extensionClinicalDocument.setId.extension is used as Composition Id
identifier.systemConstant compIdentifierSystem from fhirConstants.Composition
identifier.valueuuid()Identifier value for resource
statusConstant compStatus from fhirConstants.Composition
type.coding.codecompHeader.code.codeComposition Header type code
type.coding.dispalycompHeader.code.displayNameComposition Header type name
type.coding.systemcompHeader.code.codeSystemUse function mapCodeSystem to lookup code system
dateresource.effectiveTime.valueFormat datetime using function formatDateTime
author.referencecompHeader.author.assignedAuthor.id.extensionUse parameter practList ++ organizationsList to identify author and organization
titlecompHeader.titleComposition title
confidentialitycompHeader.confidentialityCode.codeIdentify confidentiality code for resource
attestor.modeConstant "legal"
attestor.timecompHeader.legalAuthenticator.time.valueFormat datetime using function formatDateTime
attestor.party.referencecompHeader.legalAuthenticator.assignedEntity.id.extensionUse parameter practList to identify legal authenticator
subject.referencepatientIdId of the patient resource created from recordTarget
encounter.referenceencounterIdEncompassing encounter id from parameters
custodian.referencecustodianOrgIdCustodian orgId from parameters
event.period.startcompHeader.documentationOf.serviceEvent.effectiveTime.low.valueFormat datetime using function formatDateTime
event.period.endcompHeader.documentationOf.serviceEvent.effectiveTime.high.valueFormat datetime using function formatDateTime

fun buildCompositionResource (compList, compResource, fhirConstants, practList, patientId, custodianOrgId, encompassingEncounterId, organizationsList)

Function to build composition resource. Uses createCompositionHeader function.

param compList is the list of sections.
param compResource is the C-CDA ClinicalDocument.
param fhirConstants is the list of constants used for mapping.
param practList is the list of practitioner identifiers and IDs.
param patientId is the id of the patient.
param custodianOrgId is the id for the Custodian organization.
param encompassingEncounterId is the id for the encompassing encounter if present.
param organizationsList is the list of organization identifiers and IDs.
param sectionList is the list of sections in the C-CDA document.
return A FHIR R4 formated Composition Resource.

fun getCDASection (body, templateId)

Function to get CDA Section from C-CDA Document. Filters the input to match the templateId and returns the first section.

param body is the input C-CDA request's component.
param templateId is used to match the template.
return An Object with the section of the C-CDA or an empty object.

(back to top)

createFHIRR4Condition

This module implements functions to support creation of FHIR R4 Condition.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Condition.dwl

Functions

fun createCondition (cond, fhirProblemConstants, patientId, practList, condId)

Function to create Condition FHIR object from the input XML CDA Request. Uses getIdentifier,formatDateTime and mapCodeSystem functions from cdaToFHIRTools.

param cond is a object from the CDA input XML, containing Condition information.
param fhirProblemConstants is a list of constants to be used for mapping.
param patientId is the patient ID.
param condId is ID for the resource.
param practList is a list of practitioner identifiers and IDs.
return A FHIR format Condition object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemcond.idIdentifier system for resource
identifier.valuecond.idIdentifier value for resource
clinicalStatus.coding.codecond.effectiveTime.high.valueConditionally set to "active" or "resolved"
clinicalStatus.coding.systemConstant problemClinicalStatusSystem from fhirConstants.Problem
code.coding.codecond.value.codeCondition Code
code.coding.systemcond.value.codeSystemUse function mapCodeSystem to lookup code system name
code.coding.displaycond.value.displayNameCondition display name
subject.referencepatientIdPatient ID created from recordTarget
onsetDateTimecond.effectiveTime.low.valueFormat datetime using function formatDateTime
recordedDatecond.author.time.valueFormat datetime using function formatDateTime
recorder.referencecond.author.assignedAuthor.id.extensionFilter practList to get id match

(back to top)

createFHIRR4Consent

This module implements functions to support creation of FHIR R4 Consent.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Consent.dwl

Functions

fun createConsent (advDirectiveArray, patientId, docId, practRefArray, fhirConsentConstants)

Function to create Consent FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param advDirectiveArray is an array from the CDA input XML, containing Consent information.
param fhirConsentConstants is a list of constants to be used for mapping.
param patientId is the patient ID.
param docId is the reference to DocumentReference resource.
param practRefArray is a list of practitioner identifiers and IDs.
return A FHIR format Consent object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemadvDir.idIdentifier system for resource
identifier.valueadvDir.idIdentifier value for resource
statusadvObs.effectiveTime.highConditionally set to "active"
scope.coding.systemConstant consentScopeCodingSystem from fhirConstants.Consent
scope.coding.codeConstant consentScopeCodingCode from fhirConstants.Consent
category.coding.codeadvDir.code.codeConsent Category Code
category.coding.systemConstant categorySystem from fhirConstants.Consent
dateTimeadvObs.effectiveTime.lowFormat datetime using function formatDateTime
provision.code.codeadvObs.value.codeConsent provision code
provision.code.displayadvObs.value.displayNameConsent provision code name
provision.code.systemConstant provisionCodeSystem from fhirConstants.Consent
subject.referencepatientIdPatient ID created from recordTarget
sourceReference.referencedocIdDocument Reference provided as parameter to the function
performer.referenceadvObs.author.assignedAuthor.idUse function getPractitionerRef to get practitioner id

(back to top)

createFHIRR4Coverage

This module implements functions to support creation of FHIR R4 Coverage.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Coverage.dwl

Functions

fun createCoverage (cov, fhirCoverageConstants, covId, patientId, payers)

Function to create Coverage FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param cov is an object from the CDA input XML, containing Coverage information.
param fhirCoverageConstants is a list of constants to be used for mapping.
param covId is the ID for the resource.
return A FHIR format Coverage object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemcov.idIdentifier system for resource
identifier.valuecov.idIdentifier value for resource
statuscov.performer.time.high.valueConditionally set to "active or cancelled"
type.coding.systemConstant selfPayTypeCodeSystem from fhirConstants.Coverage
type.coding.codecov.code.codeConditionally set to "pay"
type.coding.displaycov.code.codeConditionally set to "PAY"
beneficiary.referencepatientIdPatient ID created from recordTarget
payor.referencePayer or Org RefIf cov.code.code is 81(SelfPay)then it is Patient Ref else Insurance Org Ref

(back to top)

createFHIRR4Device

This module implements functions to support creation of FHIR R4 Device.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Device.dwl

Functions

fun createDevice (device, fhirDeviceConstants, deviceId)

Function to create Device FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param device is an object from the CDA input XML, containing Device information.
param fhirDeviceConstants is a list of constants to be used for mapping.
param deviceId is the ID for the resource.
return A FHIR format Device object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemdevice.idIdentifier system for resource
identifier.valuedevice.idIdentifier value for resource
type.codedevice.participant.participantRole.playingDevice.code.codeDevice Type Code
type.displayNamedevice.participant.participantRole.playingDevice.code.displayNameDevice Type Code Name
type.systemConstant deviceCodeSystem from fhirConstants.Device
manufacturerdevice.participant.participantRole.scopingEntity.descDevice manufacturer name

(back to top)

createFHIRR4DeviceUseStatement

This module implements functions to support creation of FHIR R4 DeviceUseStatement.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4DeviceUseStatement.dwl

Functions

fun createDeviceUseStatement (supply, fhirDeviceUseConstants, supplyId, patientId)

Function to create DeviceUseStatement FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param supply is an object from the CDA input XML, containing DeviceUseStatement information.
param fhirDeviceUseConstants is a list of constants to be used for mapping.
param supplyId is the ID for the resource.
param patientId is the patient ID.
return A FHIR format DeviceUseStatement object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemsupply.idIdentifier system for resource
identifier.valuesupply.idIdentifier value for resource
statussupply.statusCode.codeDevice Use Statement Status Code
subject.referencepatientIdPatient ID created from recordTarget
device.coding.codesupply.participant.participantRole.playingDevice.code.codeDevice Code
device.coding.displaysupply.participant.participantRole.playingDevice.code.displayNameDevice Code Name
device.coding.displayConstant deviceCodeSystem from fhirConstants.DeviceUseStatement

(back to top)

createFHIRR4DiagnosticReport

This module implements functions to support creation of FHIR R4 DiagnosticReport.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4DiagnosticReport.dwl

Functions

fun diagnosticReportStatusLookup (inCode)

Function to lookup diagnostic report status.

param inCode is the C-CDA format code.
return A FHIR formatted code.

fun createDiagnosticReport (diagnostic, fhirDiagRepConstants, patientId, diagId, diagnosticObservationIds)

Function to create DiagnosticReport FHIR object from the input XML CDA Request. Uses getIdentifier,formatDateTime and mapCodeSystem functions from cdaToFHIRTools.

param diagnostic is an object from the CDA input XML, containing DiagnosticReport information.
param fhirDiagRepConstants is a list of constants to be used for mapping.
param diagId is the ID for diagnostic report resource.
param patientId is the patient ID.
param diagnosticObservationIds is a list of observation IDs.
return A FHIR format DiagnosticReport object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemdiagnostic.idIdentifier system for resource
identifier.valuediagnostic.idIdentifier value for resource
statusdiagnostic.organizer.statusCode.codeUse function diagnosticReportStatusLookup to lookup status
code.coding.codediagnostic.organizer.code.codeDiagnostic Report Code
code.coding.displaydiagnostic.organizer.code.displayNameDiagnostic Report Code Name
code.coding.systemdiagnostic.organizer.code.codeSystemUse function mapCodeSystem to lookup Diagnostic Report Code System
effectivePeriod.startdiagnostic.organizer.effectiveTime.low.valueFormat datetime using function formatDateTime
effectivePeriod.enddiagnostic.organizer.effectiveTime.high.valueFormat datetime using function formatDateTime
effectiveDateTimediagnostic.organizer.effectiveTime.valueFormat datetime using function formatDateTime
subject.referencepatientIdPatient ID created from recordTarget
result.referencediagnostic.organizer.component.observationFilter diagnosticObservationIds to match current observation

(back to top)

createFHIRR4DocumentReference

This module implements functions to support creation of FHIR R4 DocumentReference.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4DocumentReference.dwl

Functions

fun createDocumentRef (advDirective, fhirDocRefConstants)

Function to create DocumenatReference FHIR object from the input XML CDA Request.

param advDirective is an object from the CDA input XML, containing Documentation information.
param fhirDocRefConstants is a list of constants used for mapping.
return A FHIR format Encounter object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
statusadvObs.effectiveTime.highConditionally set to "current"
content.attachment.contentTypeadvObs.reference.externalDocument.text.mediaTypeContent type for Document
content.attachment.urladvObs.reference.externalDocument.text.reference.valueURL for Document

(back to top)

createFHIRR4Encounter

This module implements functions to support creation of FHIR R4 Encounter.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Encounter.dwl

Functions

fun createEncounter (encounterObj, fhirEncounterConstants, encounterId, patientId, practitioners, locations)

Function to create Encounter FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param encounterObj is an object from the CDA input XML, containing Encounter information.
param fhirEncounterConstants is a list of constants to be used for mapping.
param encounterId is the ID for the resource.
param patientId is the patient ID.
param practitioners is a list of practitioner IDs and identifiers.
return A FHIR format Encounter object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemencounterObj.idIdentifier system for resource
identifier.valueencounterObj.idIdentifier value for resource
statusConstant status from fhirConstants.Encounter
class.codeencounterObj.translation.codeEncounter class code
class.displayencounterObj.translation.displayNameEncounter class code name
class.systemencounterObj.translation.codeSystemEncounter class code system name
type.coding.codeencounterObj.code.codeEncounter type code
type.coding.displayencounterObj.code.displayNameEncounter type code name
type.coding.systemencounterObj.code.codeSystemEncounter type code system name
subject.referencepatientIdPatient ID created from recordTarget
participant.type.systemConstant participantTypeSystem from fhirConstants.Encounter
participant.type.codeConstant participantTypeCode from fhirConstants.Encounter
participant.individual.referenceencounterObj.performer.assignedEntity.id.extensionLookup practitionerId from practitioners
location.location.referencelocation.locationMap locations from location parameter

fun createEncompassingEncounter (encounterObj, fhirEncounterConstants, encounterId, patientId, practitioners, location)

Function to create Encounter FHIR object from incoming C-CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param encounterObj is an object from the CDA input XML, containing Encounter information.
param fhirEncounterConstants is a list of constants to be used for mapping.
param encounterId is the ID for the resource.
param patientId is the patient ID.
param practitioners is a list of practitioner ID and identifiers.
param location is the id of the location of encounter.
return A FHIR format Encounter object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemencounterObj.idIdentifier system for resource
identifier.valueencounterObj.idIdentifier value for resource
statusConstant status from fhirConstants.Encounter
class.codeencounterObj.translation.codeEncounter class code
class.displayencounterObj.translation.displayNameEncounter class code name
class.systemencounterObj.translation.codeSystemEncounter class code system name
type.coding.codeencounterObj.code.codeEncounter type code
type.coding.displayencounterObj.code.displayNameEncounter type code name
type.coding.systemencounterObj.code.codeSystemEncounter type code system name
period.startencounterObj.effectiveTime.low.valueFormat datetime using function formatDateTime
period.endencounterObj.effectiveTime.high.valueFormat datetime using function formatDateTime
subject.referencepatientIdPatient ID created from recordTarget
hospitalization.dischargeDisposition.codeencounterObj.dischargeDispositionCode.codeConditionally set to "home"
hospitalization.dischargeDisposition.displayencounterObj.dischargeDispositionCode.displayNameConditionally set to "Home"
hospitalization.dischargeDisposition.systemConstant dischargeDispositionCodeSystem from fhirConstants.Encounter
participant.type.systemConstant participantTypeSystem from fhirConstants.Encounter
participant.type.codeConstant participantTypeCode from fhirConstants.Encounter
participant.individual.referenceencounterObj.performer.assignedEntity.id.extensionLookup practitionerId from practitioners
location.location.referencelocation.locationMap locations from location parameter

(back to top)

createFHIRR4FamilyHistory

This module implements functions to support creation of FHIR R4 FamilyHistory.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4FamilyHistory.dwl

Functions

fun createFamilyHistory (history, fhirHistoryConstants, histId, patientId)

Function to create FamilyHistory FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param history is an object from the CDA input XML, containing FamilyHistory information.
param fhirHistoryConstants is a list of constants to be used for mapping.
param histId is the ID for the resource.
param patientId is the patient ID.
return A FHIR formatted FamilyHistory object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemhistory.idIdentifier system for resource
identifier.valuehistory.idIdentifier value for resource
statusConstant "completed"
relationship.codehistory.subject.relatedSubject.code.translation.codeRelationship Code to Patient
relationship.displayhistory.subject.relatedSubject.code.translation.displayNameRelationship Name to Patient
relationship.systemConstant codeSystem from fhirConstants.FamilyHistory
sex.codehistory.subject.relatedSubject.subject.administrativeGenderCode.codeFamily Member Gender Code
sex.displayhistory.subject.relatedSubject.subject.administrativeGenderCode.displayNameFamily Member Gender Display
sex.systemhistory.subject.relatedSubject.subject.administrativeGenderCode.codeSystemFamily Member Gender Code System
bornStringhistory.subject.relatedSubject.subject.birthTime.valueFamily Member BirthTime
condition.codehistory.component.observation.value.codeFamily Member Condition Code
condition.displayhistory.component.observation.value.displayNameFamily Member Condition Display
condition.systemConstant codeSystem from fhirConstants.FamilyHistory
condition.contributedToDeathConditionally set to true if deathObservationTemplateId is found in Observation
condition.onsetAge.valuehistory.component.observation.entryRelationship.observation.value.valueOnset Age for condition
condition.onsetAge.systemConstant unitOfMeasureSystem from fhirConstants.FamilyHistory
condition.onsetAge.codehistory.component.observation.entryRelationship.observation.value.unitOnset Age Condition Code
patient.referencepatientIdPatient ID created from recordTarget

(back to top)

createFHIRR4Goal

This module implements functions to support creation of FHIR R4 Goal.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Goal.dwl

Functions

fun createGoal (goal, goalId, patientId)

Function to create Goal FHIR object from the input XML CDA Request. Uses getIdentifier and formatDateTime functions from cdaToFHIRTools.

param goal is an object from the CDA input XML, containing Goal information.
param goalId is the ID for the resource.
param patientId is the patient ID.
return A FHIR formatted Goal object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemgoal.idIdentifier system for resource
identifier.valuegoal.idIdentifier value for resource
description.codegoal.code.codeGoal Description Code
description.displaygoal.code.displayNameGoal Description Code Name
lifecycleStatusgoal.statusCode.codeGoal Status
subject.referencepatientIdPatient Id created from recordTarget
startDategoal.effectveTimeFormat datetime using function formatDateTime

(back to top)

createFHIRR4Immunization

This module implements functions to support creation of FHIR R4 Immunization.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Immunization.dwl

Functions

fun createImmunization (immItem, fhirConstants, immunizationId, patientId, performers)

Creates a FHIR Immunization object with the provided C-CDA substanceAdministration item, patient ID, and performer reference. Uses getIdentifier function from cdaToFHIRTools.

param immItem is a substanceAdministration C-CDA object.
param fhirConstants is a list of constants used for mapping.
param immunizationId is ID used for the resource.
param patientId is a String with the patient ID to use.
param performers is a list of Practitioners, PractitionerRole, or Organization to use as the performer reference.
return A FHIR formatted Immunization object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemimmItem.idIdentifier system for resource
identifier.valueimmItem.idIdentifier value for resource
statusimmItem.statusCode.codeUse function mapImmunizationStatus to lookup status
manufacturerimmItem.consumable.manufacturedProduct.manufacturerOrganization.id.rootUse function mapImmunizationManufacturer for mapping
lotNumberimmItem.consumable.manufacturedProduct.manufacturedMaterial.lotNumberTextImmunization substance lot number
vaccineCodeimmItem.consumable.manufacturedProduct.manufacturedMaterial.code.code
patient.referencepatientIdPatient ID created from recordTarget
performer.actor.referenceimmItem.performer.assignedEntity.id.extensionLookup performer id from input parameter performers
occurenceStringimmItem.effectiveTime.valueFormat datetime using formatDateTime
siteimmItem.approachSiteCode.codeUse function mapImmunizationSite for mapping
routeimmItem.routeCode.codeUse function mapImmunizationRoute for mapping
doseQuantityimmItem.doseQuantity.center.valueImmunization dose quantity
note.textimmItem.textImmunization note
reactionimmItemUse function mapImmunizationReaction with object detailed in the function

fun mapImmunizationStatus (code)

Maps the immunization status code.

param code is a String with the C-CDA status code.
return A String with the FHIR status code.

fun mapImmunizationVaccineCode (code)

Maps the immunization vaccine code.

param code is a String with the C-CDA vaccine code.
return A CodeableConcept object with the FHIR formatted code.

fun getImmunizationCvxDisplay (code)

Maps the CVX immunization vaccine code provided to a display string.

param code is a String with the CVX immunization vaccine code.
return A String with the display or blank if not matched.

fun getImmunizationOidDisplay (code)

Maps the OID immunization vaccine code provided to a display string.

param code is a String with the OID immunization vaccine code.
return A String with the display or blank if not matched.

fun mapImmunizationManufacturer (id)

Maps the immunization manufacturer ID to an organization reference.

param id is a String with the organization ID.
return A FHIR formatted Organization object reference.

fun mapImmunizationSite (code)

Maps the immunization site code to the FHIR formatted site CodeableConcept object.

param code is a String with the code to map.
return A CodeableConcept object with the site code or null if not matched.

fun mapImmunizationRoute (code)

Map the immunization route code to the FHIR formatted CodeableConcept object.

param code is a String with the route code.
return A CodeableConcept object with the route code or null if not matched.

fun mapImmunizationReaction (item)

Maps the immunization item to the FHIR formatted immunization reaction list.

param item is a substanceAdministration object to map from.
return A FHIR formatted reaction list, or null if not found.

fun mapImmunizationGetReactionObs (item)

Gets the list of reaction observations with the provided substanceAdministration object.

param item is a substanceAdministration object.
return A list of reactions observations.

(back to top)

createFHIRR4Location

This module implements functions to support creation of FHIR R4 Location.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Location.dwl

Functions

fun createLocation (location, fhirLocationsConstants, locId)

Function to create Location FHIR object from the input XML CDA Request.

param location is an object from the CDA input XML, containing Location information.
param fhirLocationsConstants is a list of constants to be used for mapping.
param locId is the ID for location resource.
return A FHIR formatted MedicationDispense object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
namelocation.playingEntity.nameLocation Name
address.linelocation.addr.streetAddressLineLocation Address Line
address.citylocation.addr.cityLocation Address City
address.statelocation.addr.stateLocation Address State
address.countrylocation.addr.countryLocation Address Country
address.postalCodelocation.addr.postalCodeLocation Address Postal Code
telecom.systemConstant "phone"
telecom.valuelocation.telecom.valueLocation's communication number
telecom.useConditionally set to phoneUse from fhirConstants.Location
type.codelocation.code.codeLocation Type Code
type.systemlocation.code.codeSystemLocation Type Code System
type.displaylocation.code.displayNameLocation Type Name

(back to top)

createFHIRR4Medication

This module implements functions to support creation of FHIR R4 Medication.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Medication.dwl

Functions

fun createMedication (med, fhirConstants, medId)

Function to create Medication FHIR object from the input XML CDA Request with parameters medicationObject, organizationId. Uses getIdentifier function from cdaToFHIRTools.

param med is an object from the CDA input XML, containing Medication information.
param fhirConstants is a list of constants used for mapping.
param medId is the ID used for resource.
return A FHIR format Medication object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
code.codemed.consumable.manufacturedProduct.manufacturedMaterial.code.codeMedication Code
code.displaymed.consumable.manufacturedProduct.manufacturedMaterial.code.displayNameMedication Name
code.systemConstant medicationCodeSystem from fhirConstants.Medication

(back to top)

createFHIRR4MedicationAdministration

This module implements functions to support creation of FHIR R4 MedicationAdministration.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationAdministration.dwl

Functions

fun createMedicationAdministration (medAdmn, fhirMedAdmnConstants, patientId, medAdmnId, dischargeMedicationId)

Function to create MedicationAdministration FHIR object from the input XML CDA Request. Uses functions getIdentifier,formatDateTime,medAdmnStatusLookup from cdaToFHIRTools.

param medAdnm is the C-CDA medication administration resource.
param fhirMedAdmnConstants is a list of constants for mapping.
param patientId is a reference to a Patient.
param medAdmnId is the id for MedicationAdministration.
param dischargeMedicationId is the discharge medication id.
return - FHIR formatted MedicationAdministration object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemmedAdmn.idIdentifier system for resource
identifier.valuemedAdmn.idIdentifier value for resource
statusmedAdmn.statusCode.codeUse function medAdmnStatusLookup to lookup status
effectivePeriod.startmedAdmn.effectiveTime.low.valueFormat datetime using function formatDateTime
effectivePeriod.endmedAdmn.effectiveTime.high.valueFormat datetime using function formatDateTime
medicationReference.referencedischargeMedicationIdMap the input parameter as a reference
subject.referencepatientIdPatient ID created from recordTarget
dosage.route.coding.systemConstant dosageRouteCodeSystem from fhirConstants.MedicationAdminstration
dosage.route.coding.codemedAdmn.routeCode.codeMedication Administration route code
dosage.route.coding.displaymedAdmn.routeCode.displayNameMedication Administration route Code Name
dosage.dose.valuemedAdmn.doseQuantity.valueMedication Adminstration Dose Quantity
dosage.rateQuantity.valuemedAdmn.rateQuantity.valueMedication Adminstration Dosage Rate Quantity

(back to top)

createFHIRR4MedicationDispense

This module implements functions to support creation of FHIR R4 MedicationDispense.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationDispense.dwl

Functions

fun createMedicationDispense (medDisp, fhirMedDispConstants, patientId, medDispId, medicationRequests, practitioners)

Function to create MedicationDispense FHIR object from the input XML CDA Request.

param medDisp is an object from the CDA input XML, containing MedicationDispense information.
param fhirMedDispConstants is a list of constants to be used for mapping.
param patientId is a reference to a Patient.
param medDispId is the ID for medication dispense resource.
param medicationRequests is a list of medication requests.
param practitioners is a list of practitioner identifier and IDs.
return A FHIR formatted MedicationDispense object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemmedDisp.idIdentifier system for resource
identifier.valuemedDisp.idIdentifier value for resource
intentConstant set to "order"
statusmedDisp.statusCode.codeMedication Dispense status
whenPreparedmedDisp.effectiveTime.low.valueMedication dispense prepared
whenHandedOvermedDisp.effectiveTime.high.valueMedication dispense handed over
quantity.valuemedDisp.quantity.valueMedication dispensed quantity
subject.referencepatientIdPatient ID created from recordTarget
medication.codemedDisp.product.manufacturedProduct.manufacturedMaterial.code.codeMedication code
medication.systemConstant medicationCodeSystem from fhirConstants.MedicationDispense
medication.displaymedDisp.product.manufacturedProduct.manufacturedMaterial.code.displayNameMedication display name
performer.actor.referenceperformer.assignedEntity.id.extensionUse parameter practitioners to filter for practitioner id
authorizingPrescription.referenceUse function getMedReferenceId and parameter medicationRequests to filter medicationRequestId

fun createDischargeMedicationDispense (medDisp, patientId, medDispId, medicationId, practitionerId)

Function to create DischargeMedicationDispense FHIR object from incoming C-CDA Request.

param medDisp is an object from the CDA input XML, containing MedicationDispense information.
param patientId is a reference to a Patient.
param medDispId is the ID for medication dispense resource.
param medicationRequests is a list of medication requests.
param practitioners is a list of practitioner identifiers and IDs.
return A FHIR formatted MedicationDispense object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemresource.idIdentifier system for resource
identifier.valueresource.idIdentifier value for resource
intentConstant set to "order"
statusresource.statusCode.codeMedication Dispense status
whenPreparedresource.effectiveTime.low.valueMedication dispense prepared
whenHandedOverresource.effectiveTime.high.valueMedication dispense handed over
quantity.valueresource.quantity.valueMedication dispensed quantity
subject.referencepatientIdPatient ID created from recordTarget
medication.reference.referencemedicationIdMedication reference id
performer.actor.referenceperformer.assignedEntity.id.extensionPractitioner reference for medication dispense

(back to top)

createFHIRR4MedicationRequest

This module implements functions to support creation of FHIR R4 MedicationRequest.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationRequest.dwl

Functions

fun createMedicationRequest (medicationRequest, fhirMedReqConstants, patientId, medReqId, practitioners)

Function to create MedicationRequest FHIR object from the input XML CDA Request.

param medicationRequest is an object from the CDA input XML, containing MedicationRequest information.
param fhirMedReqConstants is a list of constants used for mapping.
param patientId is a reference to a Patient.
param medReqId is ID for medication request.
param practitioners is a list of practitioner identifier and IDs.
return A FHIR formatted MedicationRequest object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemmedicationRequest.idIdentifier system for resource
identifier.valuemedicationRequest.idIdentifier value for resource
intentConstant set to "order"
statusmedicationRequest.statusCode.codeMedication request status
subject.referencepatientIdPatient ID created from recordTarget
medicationCodeableConcept.systemConstant medicationCodeSystem from fhirConstants.MedicationRequest
medicationCodeableConcept.codemedicationRequest.product.manufacturedProduct.manufacturedMaterial.code.codeMedication Code
medicationCodeableConcept.displaymedicationRequest.product.manufacturedProduct.manufacturedMaterial.code.displayNameMedication Name
medicationCodeableConcept.textmedicationRequest.product.manufacturedProduct.manufacturedMaterial.code.displayNameMedication Text Name
requester.referenceauthor.assignedAuthor.id.extensionFilter practitioners using the C-CDA element and get the ID from the array

(back to top)

createFHIRR4MedicationStatement

This module implements functions to support creation of FHIR R4 MedicationStatement.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationStatement.dwl

Functions

fun createMedicationStatement (medState, fhirMedStateConstants, medStateId, medReq, medDispense, patientId)

Function to create MedicationStatement FHIR object from the input XML CDA Request.

param medState is an object from the CDA input XML, containing MedicationStatement information.
param fhirMedStateConsants is a set of constants used.
param medStateId is a reference to a MedicationDispense.
param medReq is a list of medication requests.
param medDispense is a list of medication dispense.
param patientId is a reference to a Patient.
return A FHIR format MedicationStatement object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemmedState.idIdentifier system for resource
identifier.valuemedState.idIdentifier value for resource
basedOnFunction getMedReferenceId helps fetch reference for MedicationRequest
partOfFunction getMedReferenceId helps fetch reference for MedicationDispense
statusmedState.statusCode.codeConditionally mapped to "stopped"
medicationCodeableConcept.codemedState.consumable.manufacturedProduct.manufacturedMaterial.code.codeMedication Code
medicationCodeableConcept.systemConstant medicationCodeSystem from fhirConstants.MedicationStatement
medicationCodeableConcept.displaymedState.consumable.manufacturedProduct.manufacturedMaterial.code.displayNameMedication Name
subject.referencepatientIdPatient ID created from recordTarget
effectiveDateTimemedState.effectiveTime.low.valueFormat datetime using formatDateTime function filtered for dataType IVL_TS
dosage.timing.repeat.frequencymedState.effectiveTime.period.valueFilter for frequency using dataType PIVL_TS
dosage.timing.repeat.periodConstant of "1" and can be modify as desired
dosage.timing.repeat.periodUnitmedState.effectiveTime.period.unitTimePeriod Unit
dosage.doseAndRate.codemedState.effectiveTime.institutionSpecifiedConditionally set to "calculated"
dosage.doseAndRate.systemConstant value
dosage.doseQuantity.valuemedState.doseQuantity.valueMedication quantity
dosage.doseQuantity.unitmedState.doseQuantity.unitMedication quantity units
dosage.route.codemedState.routeCode.codeDosage route code
dosage.route.systemmedState.routeCode.codeSystemDosage route code system
dosage.route.displaymedState.routeCode.dispalyNameDosage route display

(back to top)

createFHIRR4Observation

This module implements functions to support creation of FHIR R4 Observation.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Observation.dwl

Functions

fun createObservation (observation, patientId, fhirObsrvConstants, obsrvId, practitionersList)

Function to create FHIR R4 Observation from CDA input XML request. Uses getIdentifier,createObservationValue,formatDateTime,ObservationStatusLookup,mapCodeSystem and mapObservationInterpretationSystem functions from cdaToFHIRTools.

param observation is a resource of C-CDA Observation type.
param patientId is the ID of the Patient resource.
param fhirObsrvConstants is the list of constants used.
param obsrvId is the ID to be used for creating the resource.
return A FHIR format Observation resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemobservation.idIdentifier system for resource
identifier.valueobservation.idIdentifier value for resource
category.systemConstant categorySystem from fhirConstants.Observation
category.codeConstant categoryCode from fhirConstants.Observation
statusobservation.statusCode.codeLookup code using function ObservationStatusLookup
code.coderesorce.code.codeTrim value for Observation code
code.displayresorce.code.displayNameObservation Code Name
code.systemresorce.code.codeSystemLookup codesystem using function mapCodeSystem
effectivePeriod.startobservation.effectiveTime.low.valueFormat datetime using function formatDateTime
effectivePeriod.endobservation.effectiveTime.high.valueFormat datetime using function formatDateTime
effectiveDateTimeobservation.effectiveTime.valueFormat datetime using function formatDateTime
valueFunction createObservationValue maps either a CodeableConcept or an object
rangeFunction createObservationRange maps reference ranges for observation
interpretation.codeinterpretationCode.codeObservation interpretation code
interpretation.systeminterpretationCode.codeSystemLookup codeSystem using mapObservationInterpretationSystem
bodySite.codeobservation.targetSiteCode.codeBody Site code
bodySite.systemConstant bodySiteSystem from fhirConstants.Observation
subject.referencepatientIdPatient ID created from recordTarget

fun createObservationValue (inValue)

Function to create value for US Core Observation using CDA C-CDA XML value.

param inValue is the XML complex type for value in C-CDA.
return Either a valueCodeableConcept or value quantity type.

fun createObservationRange (inValue)

Function to create ObservationRange for US Core Observation using C-CDA XML value.

param inValue is the XML complex type for value in C-CDA.
return a referenceRange element

fun mapObservationInterpretationSystem (sys)

Maps the Observation interpretation system.

param code is a String with the C-CDA system code.
return A String with the FHIR uri.

fun ObservationStatusLookup (incode)

Function to convert C-CDA observation status to US Core Observation status.

param incode is the input observation status in C-CDA format.
return A FHIR format status code equivalent.

(back to top)

createFHIRR4Organization

This module implements functions to support creation of FHIR R4 Organization.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Organization.dwl

Functions

fun createOrganization (org, fhirOrgConstants, orgId)

Function to create FHIR R4 Organization from CDA input XML request. Uses getIdentifier functions from cdaToFHIRTools.

param org is a resource of C-CDA Organization type.
param fhirOrgConstants is the list of constants used.
param orgId is the ID to be used for creating the resource.
return A FHIR format Observation resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemorg.idIdentifier system for resource
identifier.valueorg.idIdentifier value for resource
nameorg.nameOrg name
address.useConstant "work"
address.lineorg.addr.streetAddressLineOrg Address Line
address.cityorg.addr.cityOrg Address City
address.stateorg.addr.stateOrg Address State
address.postalCodeorg.addr.postalCodeOrg Address Postal Code
address.countryorg.addr.countryOrg Address Country
telecom.systemConstant telecomSystem from fhirConstants.Organization
telecom.valueorg.telecom.valueOrg's communication number
telecom.useConditionally set to "work"

(back to top)

createFHIRR4Patient

This module implements functions to support creation of FHIR R4 Patient.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Patient.dwl

Functions

fun createPatient (patientRole, fhirPatientConstants, birthSex, patientId)

Function to create FHIR R4 Patient from CDA input XML request with parameters patientRole, fhirPatientConstants,birthSex.

param patientRole is an object from the CDA input XML under recordTarget, containing patient information.
param fhirPatientConstants is a list of constants used for creating patient resource.
param birthSex is the assigned sex at birth of the patient. Generated from CCD's Social History template.
param patientId is the ID to be used for Patient resource.
return A FHIR formatted Patient object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
extension.valueCoding.systemConstant ombRaceCategorySystem from fhirConstants.Patient
extension.valueCoding.codepatientRole.patient.raceCode.codePatient's race code
extension.valueCoding.displaypatientRole.patient.raceCode.displayNamePatient's race name
extension.urlConstant raceCategoryText from fhirConstants.Patient
extension.valueStringpatientRole.patient.raceCode.displayName
urlConstant ombRaceUrl from fhirConstants.Patient
identifier.type.systemConstant identifierSystem from fhirConstants.Patient
identifier.type.codeConstant identifierCode from fhirConstants.Patient
identifier.valuepatientRole.id.extensionPatient Identifier
identifier.systemConstant identifierValueSystem from fhirConstants.Patient
activeConstant "true"
name.useConditionally "usual" or "maiden" or "else"
name.familypatientRole.patient.name.familyPatient's family name
name.familypatientRole.patient.name.givenPatient's given name
birthDatepatientRole.patient.birthTime.valueFormat datetime using function formatDateTime
telecom.systemConstant telecomPhone from fhirConstants.Patient
telecom.valuepatientRole.patient.telecom.phone.valuePatient's phone number
telecom.usepatientRole.patient.telecom.phone.useLookup phone use type using function homePhoneTypeLookup
genderpatientRole.patient.administrativeGenderCode.codeLookup gender code using function genderLookup
address.useConstant addressUse if patient address is of type homePhoneType
address.typeConstant addressType if patient address is of type homePhoneType
address.linepatientRole.addr.streetAddressLinePatient's street address
address.citypatientRole.addr.cityPatient's Address city
address.statepatientRole.addr.statePatient's Address state
address.postalCodepatientRole.addr.postalCodePatient's Address postalCode
address.countrypatientRole.addr.countryPatient's Address country
maritalStauts.coding.systemConstant maritalStatusSystem from fhirConstants.Patient
maritalStauts.coding.codepatientRole.patient.maritalStatusCode.codePatient's marital status code
maritalStauts.coding.displaypatientRole.patient.maritalStatusCode.displayNamePatient's marital status display
contact.relationship.coding.systemConstant contactRelationshipSystem from fhirConstants.Patient
contact.relationship.coding.codepatientRole.patient.guardian.code.codeConditionally set to "C" or "N"
contact.relationship.coding.displayConditionally set to "Emergency Contact" or "Next-of-Kin"
contact.name.useConstant nameUse from fhirConstants.Patient
contact.name.familypatientRole.patient.guardian.contact.guardianPerson.name.familyGuardian's family name
contact.name.givenpatientRole.patient.guardian.contact.guardianPerson.name.givenGuardian's given name
contact.telecom.systemConstant telecomPhone from fhirConstants.Patient
contact.telecom.valuepatientRole.patient.guardian.contact.telecom.valueGuardian's phone number
communication.language.coding.systemConstant communicationLangaugeSystem from fhirConstants.Patient
communication.language.coding.codepatientRole.patient.languageCommunication.languageCode.codePatient's language of communication
communication.preferredpatientRole.patient.languageCommunication.preferenceInd.valueConditionally true or false based on the C-CDA element

(back to top)

createFHIRR4Practitioner

This module implements functions to support creation of FHIR R4 Practitioner.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Practitioner.dwl

Functions

fun createPractitioner (pract, fhirPractConstants, practId)

Function to create FHIR R4 Practitioner from CDA input XML request. Uses getIdentifier functions from cdaToFHIRTools.

param pract is a resource of C-CDA Practitioner type.
param fhirPractConstants is the list of constants used.
param practId is the ID to be used for creating the resource.
return A FHIR format Practitioner resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systempract.idIdentifier system for resource
identifier.valuepract.idIdentifier value for resource
name.familypract.assignedPerson.name.familyPractitioner family name
name.givenpract.assignedPerson.name.*givenPractitioner given name
name.prefixpract.assignedPerson.name.*prefixPractitioner prefix
name.suffixpract.assignedPerson.name.*suffixPractitioner suffix
name.suffixpract.assignedPerson.name.*suffixPractitioner suffix
address.linepract.addr.streetAddressLinePractitioner's Address Line
address.citypract.addr.cityPractitioner's Address City
address.statepract.addr.statePractitioner's Address State
address.postalCodepract.addr.postalCodePractitioner's Address Postal Code
address.countrypract.addr.countryPractitioner's Address Country
telecom.systemConstant telecomSystem from fhirConstants's Practitioner
telecom.valuepract.telecom.valuePractitioner's communication number
telecom.usepract.telecom.useCommunication number type
qualification.codepract.code.codePractitioner's Qualification Code
qualification.displaypract.code.displayNamePractitioner's Qualification display name
qualification.systemPractitioner's Qualification System from fhirConstants's Practitioner

fun buildPractitioners (practitioners, fhirPractConstants)

Function to create a list of FHIR R4 practitioners using input C-CDA's informants, author, legalAuthenticator. Uses createPractitioner from dwl.fhirUtil.

param practitioners is the list of practitioners in C-CDA format.
param fhirPractConstants is a list of constants used for creating Practitioners.
return An array of FHIR R4 formated Practitioners.

fun buildPractitionersforRef (performers, practList, fhirPractConstants)

Function to build FHIR R4 Practitioners from Planned Procedures.

param performers a list of authors for planned procedure.
param practList is the list of informant practitioners from Header.
return An array of FHIR R4 Practitioners List.

fun buildPractRefList (perfList, practList)

Function to build a reference list of practitioners for Planned Procedure Service Request creation.

param perfList a list of authors for planned procedure.
param practList is the list of informant practitioners from Header.
return An array of id and identfiers of practitioners

fun getPractitionerRef (practList, authorId)

Function to fetch practitioner id from list.

param practList is a list of practitioner's IDs and Identifiers.
param authorId is the id to use for matching.
return A reference if a match is found else null.

(back to top)

createFHIRR4Procedure

This module implements functions to support creation of FHIR R4 Procedure.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Procedure.dwl

Functions

fun getPerformerRefs (perfList, procRefType, refIdent)

Function to create performer reference.

param perfList is the list of practitioners created.
param procRefType is a literal with either "Organization" or "Practitioner" for creating reference.
param refIdent is the identifier value to be used for lookup perfList's ID.
return A reference of type Organization or Practitioner.

fun createProcedure (proc, fhirProcConstants, patientId, procId, perfList, procType)

Function to create FHIR R4 Procedure from CDA input XML request. Uses formatDateTime,getIdentifier functions from cdaToFHIRTools.

param proc is the procedure component.
param fhirProcPersonConstants is the list of constants used to create related person FHIR resource.
param patientId is used as reference to patient in the related person resource.
param procId is the ID to be used for creating the resource.
param perfList is the list of practitioners.
param procType is a literal that identifies a Planned procedure vs a performed procedure.
return A FHIR format Procedure resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemproc.idIdentifier system for resource
identifier.valueproc.idIdentifier value for resource
stateproc.statusCode.codeConditionally set to "preparation"
code.codeproc.code.codeProcedure Code
code.displayproc.code.displayNameProcedure Name
code.systemConstant codeSystem from fhirConstants.Procedure
performedDateTimeproc.effectiveTime.valueFormat datetime using function formatDateTime
bodySite.codeproc.targetSiteCode.codeProcedure body site code
bodySite.displayproc.targetSiteCode.displayNameProcedure body site name
bodySite.systemConstant bodySiteSystem from fhirConstants.Procedure
subject.referencepatientIdPatient Id created from recordTarget
performer.referenceproc.author.assignedAuthor.id or performer.assignedEntity.representedOrganization.idUse function getPerformerRefs to fetch reference

(back to top)

createFHIRR4RelatedPerson

This module implements Create RelatedPersons for C-CDA to FHIR conversion.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4RelatedPerson.dwl

Functions

fun createRelatedPerson (relatedPerson, fhirRelatedPersonConstants, patientId, relPerId)

Function to create FHIR R4 RelatedPerson from CDA input XML request. Uses relationshipLookup and addressUseLookup functions from cdaToFhirTools library.

param relatedPerson is the relatedPerson component.
param fhirRelatedPersonConstants is the list of constants used to create related person FHIR resource.
param patientId is used as reference to patient in the related person resource.
param relPerId is the ID to be used for creating the resource .
return An array of FHIR formatted relatedPerson array.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemrelatedPerson.idIdentifier system for resource
identifier.valuerelatedPerson.idIdentifier value for resource
patient.referencepatientIdPatient Id created from recordTarget
relationship.systemConstant relationshipSystem from fhirConstants.RelatedPerson
relationship.coderelatedPerson.associatedEntity.classCodeLookup using function relationshipLookup
activeConstant value "true"
name.familyrelatedPerson.associatedEntity.associatedPerson.name.familyRelatedPerson family name
name.givenrelatedPerson.associatedEntity.associatedPerson.name.givenRelatedPerson given name
name.useConstant nameUse from fhirConstants.RelatedPerson
telecom.systemConstant telecomSystem from fhirConstants.RelatedPerson
telecom.valuerelatedPerson.associatedEntity.telecom.valueRelatedPerson's communication number
telecom.useConditionally set to telecomUse from fhirConstants.RelatedPerson
address.userelatedPerson.associatedEntity.addr.useLookup using function addressUseLookup
address.typeConditionally set to addressType from fhirConstants.RelatedPerson
address.linerelatedPerson.associatedEntity.addr.streetAddressLineRelatedPerson's Address Line
address.cityrelatedPerson.associatedEntity.addr.cityRelatedPerson's Address City
address.staterelatedPerson.associatedEntity.addr.stateRelatedPerson's Address State
address.postalCoderelatedPerson.associatedEntity.addr.postalCodeRelatedPerson's Address Postal Code
address.countryrelatedPerson.associatedEntity.addr.countryRelatedPerson's Address Country

(back to top)

createFHIRR4ServiceRequest

This module implements functions to support creation of FHIR R4 ServiceRequest.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4ServiceRequest.dwl

Functions

fun createServiceRequest (servReq, servReqId, patientId, fhirServReqConstants, practList)

Function to create ServiceRequest FHIR object from incoming C-CDA Request. Uses getIdentifier,formatDateTime,servReqStatusLookup,mapCodeSystem function from cdaToFHIRTools and getPractitionerRef.

param servReq is an object from the CDA input XML, containing ServiceRequest information.
param fhirServReqConstants is a list of constants to be used for mapping.
param servReqId is the ID for the resource.
param patientId is the patient ID.
return A FHIR formatted ServiceRequest object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemservReq.idIdentifier system for resource
identifier.valueservReq.idIdentifier value for resource
statusservReq.statusCode.codeLookup statusCode using function servReqStatusLookup
occurrenceDateTimeservReq.effectiveTime.valueFormat datetime using function formatDateTime
intentConstant value "proposal" and can update as needed
code.systemservReq.code.codeSystemConvert codeSystem using function mapCodeSystem
code.codeservReq.code.codeService Request Code
code.displayservReq.code.displayNameDisplay Name for Service Request code
subject.referencepatientIdPatientId from recordTarget
authoredOnservReq.author.time.valueFormat datetime using function formatDateTime
author.referenceservReq.author.assignedAuthor.id.extensionUse function getPractitionerRef for lookup

(back to top)


Reviews

TypeTemplate
OrganizationMulesoft
Published by
MuleSoft Organization
Published onDec 14, 2022
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.2